--test4.e

<'

import ../examples/vv_ahblite_config;
import ../e/vv_ahblite_master_seq_lib;

-- test objective - INCR burst terminated with busy
extend M0 MAIN vv_ahblite_master_sequence {
    
    !incr : INCR_RW vv_ahblite_master_sequence;
        
    num : uint;
       keep num in [50..100];
           
    body() @driver.clock is only {
    	
    	var addr: uint (bits:32); 
    	idle (66000,BYTE);
    	for i from 1 to num do {
    		gen addr keeping {
    			soft it == select {
    				50: [0..32768];
    				50: [32768..64000];
    			};
    		};
            do incr keeping{
            	.start_address == addr;
            	.busy == 0;
            	.write == i%2;
            };
            if (i<num/2){
            	busy(incr.start_address, INCR, incr.data_size, i%2);
            }else {
            	idle (incr.start_address,incr.data_size);
            };
            idle (66000,BYTE);
            
            	


    	};
    }; 

}; 

extend S1 MAIN vv_ahblite_slave_sequence {

    -- The slave sequence driver is a reactive sequence driver.
    -- This sets its default to never runs out of sequence items.
    keep soft count == MAX_UINT;
    
    body() @driver.clock is only {
    	for i from 1 to count {
    		do response keeping {
    			soft .wait_states_num == select {
			    	50: 0;
			    	50: 4;
			    };
    		}; // do term keeping...
    	}; // for i from 1 to...
    }; // body() @driver....
    
};

'>